home *** CD-ROM | disk | FTP | other *** search
/ F1 Licenseware / F1 Licenseware - Volume 1.iso / disks / 050a.dms / 050a.adf / TEXTS / chapter18.txt < prev    next >
Text File  |  1992-02-26  |  3KB  |  131 lines

  1.                      The Absolute Beginners Guide To Amos
  2.                     -------------------------------------
  3.                                Chapter eighteen
  4.                                ----------------
  5. If you take a look at EXAMPLE18.Amos you will see it is a small Procedure
  6. that you could use in your programs during development.  
  7.  
  8. The Procedure is called _SYSTEMSTATUS and when called will display the
  9. following information:
  10.  
  11. FAST MEMORY FREE
  12.  
  13. CHIP MEMORY FREE
  14.  
  15. TOTAL MEMORY FREE
  16.  
  17. DISK SPACE FREE DF0:
  18.  
  19. DISK SPACE FREE DF1: (If exists)
  20.  
  21. VARIABLE SPACE FREE
  22.  
  23. The program is very straight forward and you should have little trouble
  24. understanding it, but as usual I will cover each new command in detail.
  25. This is a good example of how useful Procedures can be.  
  26. You could build up a library of Procedures which you could use many times 
  27. over in your programs saving lots of development time, just like the Pro`s
  28. do.
  29.  
  30.  
  31. DFREE
  32. -----
  33. Returns the space left on the currently in use disk, in bytes.
  34. For example:
  35.  
  36. PRINT DFREE
  37.  
  38.  
  39. EXIST:
  40. -----
  41. You can use this command to find out if a file or drive EXISTs.
  42. Some examples:
  43.  
  44. IF EXIST (PIC.IFF) THEN LOAD IFF etc.......
  45.  
  46. IF EXIST (df1:) THEN DIR$="DF1:"
  47.  
  48.  
  49. DIR$=
  50. -----
  51. Set the current directory or drive.
  52.  
  53. DIR$="DF1:"
  54. Set the current drive to DF1:
  55.  
  56. DIR$="DF0:"
  57. Set the current drive to DF0:
  58.  
  59. DIR$="DF0:PICS/"
  60. Set the directory to PICS drawer of the disk in DF0:
  61.  
  62.  
  63. FAST FREE
  64. ---------
  65.  
  66. PRINT FAST FREE would print the amount of FAST memory available in bytes.
  67.  
  68.  
  69. CHIP FREE
  70. ---------
  71.  
  72. PRINT CHIP FREE would print the amount of CHIP memory available, this can be
  73. used to good effect.  For example, if you wanted to check if the Amiga your 
  74. program was running on had more than 512k then you could do this:
  75.  
  76. IF CHIP FREE+FAST FREE>512*1024 then ...............
  77.  
  78.  
  79. That covers all the new commands that pop up in EXAMPLE18.Amos.  Here are a
  80. few more that may be of use or interest to you especially if you are
  81. thinking of writing a utility program that needs to manipulate disks and
  82. files etc.                           
  83.             ---------------------------------------------
  84.  
  85. KILL Filename$
  86. --------------
  87. KILL deletes the file in Filename$ from the current drive, once KILLed you 
  88. will not be able to recover this file.  An example:
  89.  
  90. KILL "readme.doc"       Will delete the file readme.doc
  91.  
  92.  
  93. RENAME old$ TO new$
  94. -------------------
  95. Allows you to change the name of a file.  As an example let us say we want to
  96. RENAME readme.doc TO instructions.doc, we would execute the following:
  97.  
  98. RENAME readme.doc TO instructions.doc
  99.  
  100.  
  101. MKDIR
  102. -----
  103. Creates a drawer (or folder if you like) on the current disk.  As an example
  104. lets say we need a drawer to store our samples in we would:
  105.  
  106. MKDIR "samples"
  107.  
  108.  
  109. LDIR
  110. ----
  111. Lists the current directory of your disk to the printer.
  112.  
  113.   
  114. LLIST
  115. -----
  116. Executing this command will print out your Amos program listing to your
  117. printer.  This command does not work on some versions of Amos.
  118. * See Chapter 20 for how to get round this.
  119.  
  120. LPRINT
  121. ------
  122. You can use this in exactly the same way as PRINT except the output is to 
  123. your printer:
  124.  
  125. LPRINT "THIS TEXT WILL BE SENT TO MY PRINTER"
  126.  
  127. OK that is enough new commands for this chapter.  
  128.  
  129.                            End of chapter eighteen
  130.                            ^^^^^^^^^^^^^^^^^^^^^^^
  131.